package com.hanoi.wiki.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hanoi.wiki.model.json.ResponseJsonObject;
import com.hanoi.wiki.model.json.UserJson;

@RequestMapping("")
public interface UserController extends BaseController {	
	
	@RequestMapping(value = "/detail/{id}", method = RequestMethod.GET)
	public @ResponseBody ResponseJsonObject getUser(@PathVariable int id);
	
	@RequestMapping(value = "/create", method = RequestMethod.POST)
	public @ResponseBody ResponseJsonObject saveUser(@RequestBody UserJson user);
	
	@RequestMapping(value = "/remove/{id}", method = RequestMethod.GET)
	public @ResponseBody ResponseJsonObject removeUser(@PathVariable int id);
	
	@RequestMapping(value = "/all", method = RequestMethod.GET)
	public @ResponseBody ResponseJsonObject getUserList();
	
	@RequestMapping(value = "/update", method = RequestMethod.POST)
	public @ResponseBody ResponseJsonObject updateUser(@RequestBody UserJson user);
	
	@RequestMapping(value = "/name/{name}", method = RequestMethod.GET)
	public @ResponseBody ResponseJsonObject getUserByName(@PathVariable String name);
}
